Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add tic-tac-toe React prototype #665

Merged
merged 9 commits into from
Feb 25, 2025

Conversation

zairahira
Copy link
Member

Checklist:

Closes #642

@zairahira zairahira changed the title add prototype feat: add tic-tac-toe React prototype Nov 8, 2024
@jdwilkin4
Copy link
Contributor

Hey @zairahira !

The prototype looks good so far.

This will be discussed more in tuesday's meeting, but we are changing what will be shipped by Christmas.
We are going to ship everything from HTML through React fundamentals. This change will be more manageable for all teams involved 👍

As a result, let's push pause on the tic toe game and resume in Q1 of 2025

@jdwilkin4 jdwilkin4 added the Labs Team This work is for the labs team only label Nov 18, 2024
@zairahira zairahira removed the BLOCKED label Jan 16, 2025
@zairahira zairahira marked this pull request as ready for review January 16, 2025 09:34
Copy link
Contributor

@jdwilkin4 jdwilkin4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to test this locally and it is working well on my end.
Most of comments center around exports.

The structure for how we build react projects might change but for now, we should assume that there is just going to be one file for the parent and child components and one export instead of multiple.

@@ -0,0 +1,84 @@
export const Square = ({ value, onClick }) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking at the current react implementation on learn, I don't know if we are going to be able to export multiple child components into a parent component.

right now, it looks like we just have one index.jsx file and the parent and child components are all in that file.
So we might need to remove these export keywords for all of the child components.

11. Your `Board` component should render a grid of `Square` components for the 3x3 Tic-Tac-Toe board.
12. You should create and export a `resetGame` function that resets the game state to its initial values when triggered.
13. You should create and export an `App` component that renders the `Board` component.
14. The `App` component should be rendered to the DOM inside a `div` with the class `App`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could remove this because looking at the other react projects, it looks like we are already giving them the boilerplate code in the index.html

@zairahira
Copy link
Member Author

zairahira commented Feb 25, 2025

Thank you for sharing the feedback Jessica.

I have implemented the following suggestions:

  • Exported the Board component instead of multiple components.
  • Updated the index.html to properly import and render the Board component.
  • Remove App.
  • Update user stories.

Copy link
Contributor

@jdwilkin4 jdwilkin4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left one small comment but otherwise this is good to go

@jdwilkin4 jdwilkin4 merged commit f57d6d7 into freeCodeCamp:main Feb 25, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

chore: create React prototype for tic tac toe game
2 participants